/**
 * Selling Partner API for Orders
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { VerificationStatus } from './VerificationStatus.js'

/**
 * The ValidVerificationDetail model module.
 * @module orders_v0/model/ValidVerificationDetail
 * @version v0
 */
export class ValidVerificationDetail {
  /**
   * Constructs a new <code>ValidVerificationDetail</code>.
   * The types of verification details that may be provided for the order and the criteria required for when the type of verification detail can be provided. The types of verification details allowed depend on the type of regulated product and will not change order to order.
   * @alias module:orders_v0/model/ValidVerificationDetail
   * @class
   * @param verificationDetailType {String} A supported type of verification detail. The type indicates which verification detail could be shared while updating the regulated order. Valid value: `prescriptionDetail`.
   * @param validVerificationStatuses {[VerificationStatus]} A list of valid verification statuses where the associated verification detail type may be provided. For example, if the value of this field is [\"Approved\"], calls to provide the associated verification detail will fail for orders with a `VerificationStatus` of `Pending`, `Rejected`, `Expired`, or `Cancelled`.
   */
  constructor (verificationDetailType, validVerificationStatuses) {
    this.verificationDetailType = verificationDetailType
    this.validVerificationStatuses = validVerificationStatuses
  }

  /**
   * Constructs a <code>ValidVerificationDetail</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {ValidVerificationDetail} obj Optional instance to populate.
   * @return {ValidVerificationDetail} The populated <code>ValidVerificationDetail</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new ValidVerificationDetail()
      if (data.hasOwnProperty('VerificationDetailType')) { obj.verificationDetailType = ApiClient.convertToType(data.VerificationDetailType, 'String') }
      if (data.hasOwnProperty('ValidVerificationStatuses')) { obj.validVerificationStatuses = ApiClient.convertToType(data.ValidVerificationStatuses, [VerificationStatus]) }
    }
    return obj
  }
}

/**
 * A supported type of verification detail. The type indicates which verification detail could be shared while updating the regulated order. Valid value: `prescriptionDetail`.
 * @member {String} verificationDetailType
 * @type {String}
 */
ValidVerificationDetail.prototype.verificationDetailType = undefined

/**
 * A list of valid verification statuses where the associated verification detail type may be provided. For example, if the value of this field is [\"Approved\"], calls to provide the associated verification detail will fail for orders with a `VerificationStatus` of `Pending`, `Rejected`, `Expired`, or `Cancelled`.
 * @member {[VerificationStatus]} validVerificationStatuses
 * @type {[VerificationStatus]}
 */
ValidVerificationDetail.prototype.validVerificationStatuses = undefined
